# from flask import Flask
# from flask_cors import CORS
#
# app = Flask(__name__)
# CORS(app)
#
# @app.route('/initialize', methods=['GET', 'POST'])
# def initialize():
#     # 处理初始化请求的逻辑
#     return 'Initialization successful'
#
# if __name__ == '__main__':
#     app.run(debug=True)
from flask import Flask, send_from_directory, render_template

app = Flask(__name__,  static_folder='dist/static', template_folder='dist')

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/static/<path:path>')
def static_files(path):
    return send_from_directory('static', path)

# 在这里可以定义其他 API 路由
@app.route('/api/hello')
def hello_api():
    return {'message': 'Hello from Flask API!'}

if __name__ == '__main__':
    host = '0.0.0.0'  # 替换成你的本机 IP 地址
    port = 50000  # 你想要使用的端口号
    app.run(debug=True,host=host, port=port)



